package com.cs2.volunteerpostbackend.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cs2.volunteerpostbackend.po.Image;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ImageMapper extends BaseMapper<Image> {

    @Select("SELECT i.* FROM image i " +
            "JOIN moment_image mi ON i.id = mi.image_id " +
            "WHERE mi.moment_id = #{momentId}")
    List<Image> selectImagesByMomentId(String momentId);
}
